package org.butterfly.watchdog.annotations;

import org.butterfly.watchdog.WatchDog;
import org.butterfly.watchdog.config.WatchDogConfiguration;
import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * To be used together with @Configuration classes
 * A spring autoconfiguration sample with Enable*** , @Import and @ImportAware
 *
 * @author drake
 * @since 2022/3/29
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({WatchDog.class, WatchDogConfiguration.class})
public @interface EnableWatchDog {
    boolean enable() default true;

    int firstDelay() default 1000;

    int period() default 1000;
}
